package com.teach.service;

import com.alibaba.fastjson.JSON;
import com.teach.dto.AuthDto;
import com.teach.service.impl.AdminServiceImpl;
import org.junit.jupiter.api.Test;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2022-05-11 9:49
 * Version : 1.0
 * Copyright 2022 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class AdminServiceTest {

  private AdminService adminService = new AdminServiceImpl();

  @Test
  public void login(){
    try{
      System.out.println("测试登录成功");
      AuthDto auth = adminService.login("admin", "123");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }


    try{
      System.out.println("测试用户名错误");
      AuthDto auth = adminService.login("admiadfasdfdsafn", "123");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }



    try{
      System.out.println("测试密码错误");
      AuthDto auth = adminService.login("admin", "12322323233232");
      System.out.println(JSON.toJSONString(auth,true));
    }catch (Exception ex){
      ex.printStackTrace();
    }
  }
}
